package com.example.blindinterfacetest;

import java.util.Locale;

import android.app.Application;
import android.speech.tts.TextToSpeech;

public class BlindInterfaceTest extends Application implements TextToSpeech.OnInitListener {
	public TextToSpeech tts = null;
	
	public void onCreate(){
		tts = new TextToSpeech(this, this);
	}

	@Override
	public void onInit(int status) {
		if(status == TextToSpeech.SUCCESS){
			int result = tts.setLanguage(Locale.US);
			
			if(result == TextToSpeech.LANG_MISSING_DATA || result == TextToSpeech.LANG_NOT_SUPPORTED)
				System.out.println("This language is not supported.");
			
			tts.speak("Welcome to Accessible World! Please swipe down with two fingers if you are visually impaired.", TextToSpeech.QUEUE_ADD, null);
		}
		else
			System.out.println("TTS failed to initialize.");
	}
}
